{% extends "base.html" %}

{% block content %}
<div class="row">
    <div class="col-md-12 mb-4">
        <h2>成员列表</h2>
    </div>
</div>

<div class="row row-cols-1 row-cols-md-3 g-4">
    {% for user in users %}
    <div class="col">
        <div class="card h-100">
            <div class="card-body">
                <h5 class="card-title">{{ user.name }}</h5>
                <h6 class="card-subtitle mb-2 text-muted">{{ '管理员' if user.role == 'admin' else '成员' }}</h6>
                <p class="card-text">
                    {% if user.skills %}
                    <strong>技能:</strong><br>
                    {% for skill in user.skills %}
                    <span class="badge bg-secondary">{{ skill.name }}</span>
                    {% endfor %}
                    {% else %}
                    <em>暂无技能标签</em>
                    {% endif %}
                </p>
            </div>
            <div class="card-footer">
                <a href="{{ url_for('users.profile', id=user.id) }}" class="btn btn-primary">查看档案</a>
            </div>
        </div>
    </div>
    {% endfor %}
</div>
{% endblock %}